//取日期的前几天
function addDate(currDate, days) {
    var date = new Date(currDate);
    date.setDate(currDate.getDate() - days);
    var newDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
    return new Date(newDate);
}

